# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cargo-bloat
pkgver=0.11.0
pkgrel=0
pkgdesc="Find out what takes most of the space in your Rust executable"
url="https://github.com/RazrFalcon/cargo-bloat"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"  # limited by rust/cargo
license="MIT"
depends="cargo"
source="https://github.com/RazrFalcon/cargo-bloat/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	minimize-size.patch
	"
_cargo_opts="--frozen --features regex-filter"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	cargo install $_cargo_opts --offline --path . --root="$pkgdir/usr"
	rm "$pkgdir"/usr/.crates*
}

sha512sums="
60d15cc561b8b173e2eba405930a3fd048da30c6d29fe612d5b55b8aa9f6c907af72d500a257675df5e160c299d101a906a773352509439d8292592d4b96157a  cargo-bloat-0.11.0.tar.gz
d9442983e29139c6d2b4ab260a889a2751c16d6786e27e879076e048b3fd8f1ec3d3f8076464b462c20559d662f0370466e1d70c89e4f81353539ae54fb98e89  minimize-size.patch
"
